import request from '@/untils/request'

//登录
export const login=(data)=>{
  return request({
    url:`login`,
    method:"post",
    data
  })
}
export const selectMenu=(data)=>{
  return request({
    url:`selectMenuByAffiliationAndPosition`,
    method:"post",
    data
  })
}
export const faburenwu=(data)=>{
  return request({
    url:`insertAnct`,
    method:"post",
    data
  })
}

export const JumpInfo=(params)=>{
  return request({
    url:`JumpInfo`,
    method:"post",
    params:params
  })
}

export const deleteUser=(params)=>{
  return request({
    url:`deleteUser`,
    method:"post",
    params:params
  })
}




export const selectAllByDepartment=()=>{
  return request({
    url:`selectAllByDepartment`,
    method:"post"
  })
}
//案例
export const userRegisterService = ({ username, password, repassword }) =>
  request.post('/api/reg', { username, password, repassword })


//查询所有生产部门的员工
// 
// 
export const userProduct = (pageNum = 1, pageSize = 8, name = '') => {
  return request({
    url: `selectAllPage`,
    method: 'GET',
    params: {
      pageNum: pageNum,
      pageSize: pageSize,
      name: name
    }
  })
}

//添加生产部人员
export const userProductAdd = (form) => {
  return request({
    url: `addProduct`,
    method: 'POST',
    data: form
  })
}

//修改生产部人员
export const userProductUpdateById = (form) => {
  return request({
    url: `updateProduct`,
    method: 'put',
    data: form
  })
}